import java.util.ArrayList;

public class Player
{

	private String name;
	private char[] password;
	private int points;
	private ArrayList<Card> hand = new ArrayList<Card>();

	public Player()
	{
		this.name = "Player";
		this.password = null;
		this.points = 0;
		this.hand = new ArrayList<Card>();
	}

	public Player(String name, char[] password)
	{
		super();
		this.name = name;
		this.password = password;
	}

	/**
	 * @return the name
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * @return the password
	 */
	public char[] getPassword()
	{
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(char[] password)
	{
		this.password = password;
	}

	/**
	 * @return the points
	 */
	public int getPoints()
	{
		return points;
	}

	/**
	 * @param points
	 *            the points to set
	 */
	public void setPoints(int points)
	{
		this.points = points;
	}

	/**
	 * @return the hand
	 */
	public ArrayList<Card> getPlayerHand()
	{
		return hand;
	}

	/**
	 * @param card
	 *            the hand to set
	 */
	public void setPlayerHand(Card card)
	{
		hand.add(card);
	}
	
	/**
	 * @return number of cards
	 */
	public int getPlayerHandSize()
	{
		return hand.size();
	}
	
	public void removeCards()
	{
		hand = new ArrayList<Card>();
	}
	

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		return String.format(
				"name = %s, password = %s, points = %s, hand = %s",
				getName(), getPassword(), getPoints(), getPlayerHand());
	}

}
